import request from '@/utils/request'

// 查询商户申请列表
export function listSeller(query) {
  return request({
    url: '/business/seller/list',
    method: 'get',
    params: query
  })
}

// 查询商户申请详细
export function getSeller(sellerId) {
  return request({
    url: '/business/seller/' + sellerId,
    method: 'get'
  })
}

// 新增商户申请
export function addSeller(data) {
  return request({
    url: '/business/seller',
    method: 'post',
    data: data
  })
}

// 修改商户申请
export function updateSeller(data) {
  return request({
    url: '/business/seller',
    method: 'put',
    data: data
  })
}

// 删除商户申请
export function delSeller(sellerId) {
  return request({
    url: '/business/seller/' + sellerId,
    method: 'delete'
  })
}

export function changeSellerStatus(sellerId, status) {
    const data = {
        sellerId,
        status
    }
    return request({
        url: '/business/seller/changeStatus',
        method: 'put',
        data: data
    })
}
export function changeSellerAudit(sellerId, audit) {
    const data = {
        sellerId,
        audit
    }
    return request({
        url: '/business/seller/changeStatus',
        method: 'put',
        data: data
    })
}
export function sellerTop(sellerId, isTop) {
    const data = {
        sellerId,
        isTop
    }
    return request({
        url: '/business/seller/sellerTop',
        method: 'put',
        data: data
    })
}
export function sellerCancelTop(sellerId, isTop) {
    const data = {
        sellerId,
        isTop
    }
    return request({
        url: '/business/seller/sellerCancelTop',
        method: 'put',
        data: data
    })
}
